module(
    name = "rules_zig",
    version = "0.1.0",
    compatibility_level = 1,
)

bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "platforms", version = "0.0.8")

zig = use_extension("//zig:extensions.bzl", "zig")
zig.toolchain(zig_version = "0.11.0")
use_repo(zig, "zig_toolchains")

register_toolchains("@rules_zig//zig/target:all")

register_toolchains("@zig_toolchains//:all")

bazel_dep(name = "aspect_bazel_lib", version = "2.0.1", dev_dependency = True)
bazel_dep(name = "stardoc", version = "0.6.2", dev_dependency = True, repo_name = "io_bazel_stardoc")
bazel_dep(name = "gazelle", version = "0.34.0", dev_dependency = True, repo_name = "bazel_gazelle")
bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.5.0", dev_dependency = True)
bazel_dep(
    name = "buildifier_prebuilt",
    version = "6.3.3",
    dev_dependency = True,
)
bazel_dep(name = "rules_multirun", version = "0.6.1", dev_dependency = True)
bazel_dep(name = "rules_python", version = "0.27.0", dev_dependency = True)
bazel_dep(
    name = "rules_bazel_integration_test",
    version = "0.20.0",
    dev_dependency = True,
)

bazel_binaries = use_extension(
    "@rules_bazel_integration_test//:extensions.bzl",
    "bazel_binaries",
    dev_dependency = True,
)

# NOTE: Keep in sync with WORKSPACE.
bazel_binaries.download(version_file = "//:.bazelversion")
bazel_binaries.download(version = "6.3.0")
use_repo(
    bazel_binaries,
    "bazel_binaries",
    "bazel_binaries_bazelisk",
    "build_bazel_bazel_.bazelversion",
    "build_bazel_bazel_6_3_0",
)

# TODO[AH] Should be an implicit transitive dependency through rules_bazel_integration_test.
# However, if we do not include it explicitly, then the runfiles resolution for
# cgrindel_bazel_starlib/shlib/lib/message.sh fails in
# rules_bazel_integration_test/tools/update_deleted_packages.sh when invoked
# through the rules_multirun target //util:update.
bazel_dep(name = "cgrindel_bazel_starlib", version = "0.18.1", dev_dependency = True)
